import Vue from 'vue'
import Router from 'vue-router'
import Index from '@/components/Index'
import Login from '@/views/Login'

Vue.use(Router);

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Index',
      component: Index,
      children: [
        {
          path: '/serverList',
          component: resolve => require(['@/views/ServerList.vue'], resolve),
        },
        {
          path: '/activityList',
          component: resolve => require(['@/views/ActivityList.vue'], resolve),
        },
        {
          path: '/codeTemplateList',
          component: resolve => require(['@/views/AddCodeTemplate.vue'], resolve),
        }
      ]
    },
    {
      path: '/login',
      name: 'Login',
      component: Login
    }
  ]
})
